package coreEvent

import (
	"log"

	"smartconn.cc/liugen/audio"
	"smartconn.cc/tosone/parsing/parsing"
	"smartconn.cc/tosone/ra_main/PFSE"
	"smartconn.cc/tosone/ra_main/config"
)

// BookStart 书本放上
func BookStart() {
	audio.StopBGM()
	setStatus("bookStatus", "true")
	PFSE.StartMonitor(config.PageFlipFreq)
	// PageFlip.OnPageFlipStart(func(str string) { log.Println("Page Flip Event: start.") })
	// pageFlipEventUnregister = PageFlip.OnPageFlipEnd(func(str string) { log.Println("Page Flip Event: stop."); Pagevt(str) })

	log.Println("Book start")

	Pagevt("")
}

// BookStop 书本拿下
func BookStop() {
	audio.StopRecord()
	audio.StopBGM()

	PFSE.StopMonitor()

	resetStatus()
	parsing.Stop()

	log.Println("Book stop")
}
